package com.geez.bbl.morpho;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author biniam.gebremichael
 * @since 6/28/12
 */
public class StatCollector implements Comparable<StatCollector> {
    private String word;
    private String theRoot;
    private List<String> roots = new ArrayList<String>();
    private Map<String, String> prop = new HashMap<String, String>();

    public StatCollector(String word) {
        this.word = word;
    }

    @Override
    public int compareTo(StatCollector o) {
        return word.compareTo(o.getWord());
    }

    public void setProperty(String property, String value) {
        prop.put(property, value);
    }

    public String getWord() {
        return word;
    }

    public List<String> getRoot() {
        return roots;
    }

    public void setRoot(String root){
        roots.add(root);
    }

    public void setTheRoot(String theRoot) {
        this.theRoot = theRoot;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        StatCollector that = (StatCollector) o;

        if (word != null ? !word.equals(that.word) : that.word != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return word != null ? word.hashCode() : 0;
    }

    public String getTheRoot() {
        return theRoot;
    }


}
